UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n49VxAy7Xlqp9D8z5fywEYWFGE09l/fvu0jqT7VqZVY='
WHERE
key_id = '6e6849b2057df3e83ba3516ab69ac11c0acbbea19e235187376738992863f6c4'
AND (
token = 'n49VxAy7Xlqp9D8z5fywEYWFGE09l/fvu0jqT7VqZVY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)