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