UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vL3pWURq1KWNlbWoS57n3DxlvqD9D/ai9FTpWJzR5HY=' 
WHERE 
  key_id = 'd570a0f29237cacf7cf7717a86aaddddd58f856f222eca2e251231d7656ec736' 
  AND (
    token = 'vL3pWURq1KWNlbWoS57n3DxlvqD9D/ai9FTpWJzR5HY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036