UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3Fl+HOo0YTgrc9xYmIBiJqtxIg5jkYwa/55Cz44ofVc='
WHERE
key_id = 'f271404aac867c4ebf7ef9137c59d2848acdc147f633adfc78daa7de29734195'
AND (
token = '3Fl+HOo0YTgrc9xYmIBiJqtxIg5jkYwa/55Cz44ofVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)