UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ACyPLghuDVarx5HOMWO5xkEf83ikKVBeW/pNN5rVT7Q=' 
WHERE 
  key_id = '97c026f103d6a1806d5b46c816cb4aa4ea19b60594b3710c683166f7a6c9cbb2' 
  AND (
    token = 'ACyPLghuDVarx5HOMWO5xkEf83ikKVBeW/pNN5rVT7Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032