UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cr1z/eVpEDylcaOwZN/GzDXNqN1Q7A0KaMf9E4YaCoA=' 
WHERE 
  key_id = '6b5ca419f4a56702c1f13ae108aaac4bacf1aed5e9c307e41e93a60a4a86c2f5' 
  AND (
    token = 'Cr1z/eVpEDylcaOwZN/GzDXNqN1Q7A0KaMf9E4YaCoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039