UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vU14hpuiiqM+Oh/aTGIEM9pDZ8tCUyis7ELsZdJqios='
WHERE
key_id = '3fcbef786c616ace4cae8eda00d45be881643871c406ac4a4c149de4b3a49c0b'
AND (
token = 'vU14hpuiiqM+Oh/aTGIEM9pDZ8tCUyis7ELsZdJqios='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)