UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C3/cAPefG3vTB+asSYLTBwEH7zSOxlteJWNk2ZZAi4g=' 
WHERE 
  key_id = 'c94c663e8300dce55636166f431e766340704c14f77cfc289cf725f9892af201' 
  AND (
    token = 'C3/cAPefG3vTB+asSYLTBwEH7zSOxlteJWNk2ZZAi4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042