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

Query time 0.00043