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