UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ME+zxVlf4nsrCcyVqb5PGHN+5pWjYM02f8nAvInL8+M='
WHERE
key_id = '80814fa9638532986c9032f3c960f609980d8a29a73593663a127bb423c7f1ba'
AND (
token = 'ME+zxVlf4nsrCcyVqb5PGHN+5pWjYM02f8nAvInL8+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)