UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l0j7TG4CbtrpTGVTpnqK1HzzRYPAehDhd9iuc1VZ77g='
WHERE
key_id = '16bdb32586864d70f931ddb2907d7f62d03dee3e52ad880db56d80b0e21e6f42'
AND (
token = 'l0j7TG4CbtrpTGVTpnqK1HzzRYPAehDhd9iuc1VZ77g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)