UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZVEsYCy9B1JcLO6Rup/A/9fQzxvUj39/22jDuf5xrbI=' 
WHERE 
  key_id = '98e9c130f70c447529b7f6c06bc065e5b83b0a55b7366ac41ec7f3e544bc3a58' 
  AND (
    token = 'ZVEsYCy9B1JcLO6Rup/A/9fQzxvUj39/22jDuf5xrbI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027