UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0hUmTd/TFS2EF2tyKd+n5sOHlR1DIROJluBPvZZjLgo=' 
WHERE 
  key_id = 'd57cb9ad905f937efc7ccd6ceaa3d65a6e0390f82798868f5509c916937d56aa' 
  AND (
    token = '0hUmTd/TFS2EF2tyKd+n5sOHlR1DIROJluBPvZZjLgo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033