UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YW75ZBZ1y4aX+MoKCqRKte26HIBDe3DQXUucYbz97N0='
WHERE
key_id = 'e225c374059eb7801823635632ec3bfb45ef156cde433f7edf453d66a44587c3'
AND (
token = 'YW75ZBZ1y4aX+MoKCqRKte26HIBDe3DQXUucYbz97N0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)