UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HwOdd1FMZgCXm9gGVoiSan8ZR9GsxdVZ8gR2R958ooA='
WHERE
key_id = 'ebecb05443620d289330b3cc1a7749c0c18408e7ca6cce73cd37e3edbcf3cbe3'
AND (
token = 'HwOdd1FMZgCXm9gGVoiSan8ZR9GsxdVZ8gR2R958ooA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)