UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hug+W/mr1FjuwM3rV+GNk2kzNvXfjFtQznqzNXhLpVw=' 
WHERE 
  key_id = '7b13ce7cff26eabcf5cc62698feb2fa76dd2e4ad58c5260184446774ecc123f4' 
  AND (
    token = 'Hug+W/mr1FjuwM3rV+GNk2kzNvXfjFtQznqzNXhLpVw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017