UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6khv3ehikb3fOENiRJ1gSYHd79WgYv/oL+DWyEvquI8='
WHERE
key_id = '9d707af4e11171da631fdd5882343afa9992584be153fdbc8054d7038f4992a7'
AND (
token = '6khv3ehikb3fOENiRJ1gSYHd79WgYv/oL+DWyEvquI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)