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