UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CqXJy5ccxkncWZXm2PfyNnW0ZwzAi00FZx9YM1KREbk='
WHERE
key_id = 'ca860bf48e7e0aea50915ebd33c9774da522e521b112113af299af407144b832'
AND (
token = 'CqXJy5ccxkncWZXm2PfyNnW0ZwzAi00FZx9YM1KREbk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)