UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kwzW9TnA+SzPNK9DRn8udgHylKrlEl6tHbxl8W+3BLM='
WHERE
key_id = 'a7554376d3d656c1dceee571ffa8ec9cabb6dbc45f5b54f18e30e7868ae49062'
AND (
token = 'kwzW9TnA+SzPNK9DRn8udgHylKrlEl6tHbxl8W+3BLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)