UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RGY3uscDXSD6NE/PWRa8+JJ1XBs+KLqzztfiSwrdtpU='
WHERE
key_id = 'ed2982f8ca09a29d3be3d087b1a47011d1e501f032d1d983ddd149a95b8ca6d5'
AND (
token = 'RGY3uscDXSD6NE/PWRa8+JJ1XBs+KLqzztfiSwrdtpU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)