UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ykVO3poeNRsdJh2bBR7YqsQUhVUj+tDKaL7hkKl7aec='
WHERE
key_id = '42b04f0dbbfee75052823d179ec7fe80388db79314a24b9fd708f4d38450cdad'
AND (
token = 'ykVO3poeNRsdJh2bBR7YqsQUhVUj+tDKaL7hkKl7aec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)