UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OWaVfttuTXDG1dsy0soRqSELfcEfnyXW3hRvSMBIBIY=' 
WHERE 
  key_id = '33762cb1ac858fe84dd5b2484de53c12653bafa7feda6e87f81be805b181d131' 
  AND (
    token = 'OWaVfttuTXDG1dsy0soRqSELfcEfnyXW3hRvSMBIBIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019