UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4E3617zJJUcTvHKdQg6eFbcAxu13IIZvp/wkbB4VoLs='
WHERE
key_id = 'ff017869195586bf6713fe08fb2ae7ffe2e0c27ecec7003c8f4a51abd709cc87'
AND (
token = '4E3617zJJUcTvHKdQg6eFbcAxu13IIZvp/wkbB4VoLs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)