UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm5G5eKmXdyKj1DaWkkXKjQ/TzSNzOm1fFOmCE6q7bwo='
WHERE
key_id = '52b92542603eca9b68ca6d24be5560f56f55d4b919efb03b5b8317d989fe55ff'
AND (
token = 'm5G5eKmXdyKj1DaWkkXKjQ/TzSNzOm1fFOmCE6q7bwo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)