UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OGCtH67+UpCGWo/ZKvJv+5mfBAOiExkbgqPHKouF3Sk='
WHERE
key_id = 'b62e12bb842a7021a84689da1543ffa08f6c09e4aae6dc859c3ef9a001b8c5d5'
AND (
token = 'OGCtH67+UpCGWo/ZKvJv+5mfBAOiExkbgqPHKouF3Sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)