UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HVokoCNgkO1eowiuoBYAk64Dm8noupXINkwjPCUfDNA=' 
WHERE 
  key_id = 'cbaf821256d03825c79e40145f3f500ae475d4eb4513c0ae45093b8225a589ed' 
  AND (
    token = 'HVokoCNgkO1eowiuoBYAk64Dm8noupXINkwjPCUfDNA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027