UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '75Y+TTm0BffydN8m68k0bmyNJG7hkm0+RAW5h2AUf7A=' 
WHERE 
  key_id = 'e1514c016345cca0d27f4f83aec64c3d655b6d1820e9301b633d9b508405d9f9' 
  AND (
    token = '75Y+TTm0BffydN8m68k0bmyNJG7hkm0+RAW5h2AUf7A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041