UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1bCjzTkfq1XCBqU7WcDH23Q58ljALZMyubhOYRykGho='
WHERE
key_id = '1efc69d6eb54b6c698bd4afb7213b5448ca9c9852aa22287daa4a8742a97be4c'
AND (
token = '1bCjzTkfq1XCBqU7WcDH23Q58ljALZMyubhOYRykGho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)